#include<stdio.h>
void swap(char* a,char* b){
	char c;
	c=*a;
	*a=*b;
	*b=c;
}

void revstr(char* s){
char* start=s,*end=s,*p=s;

while(*p++!='\0'){
   if(*p==' '||*p=='\0'){

	  end=p-1;
		while(start<end){
		swap(start++,end--);
	}
	start=end=p+1;   
}

}
start=s;end=p-2;
while(start<end){
swap(start++,end--);
}
}



int main(){
char s[]="I am from  Shanghai";
revstr(s);
printf("%s\n",s);
return 0;


}
